﻿#if NETSTANDARD2_0 || NETCOREAPP3_0
#else
using Longbow.Configuration;
using System.Configuration;
#endif

namespace Longbow.Cache
{
#if NETSTANDARD2_0 || NETCOREAPP3_0
    /// <summary>
    /// CacheCorsItem 配置类
    /// </summary>
    internal class CacheCorsItem : ICacheCorsItem
    {
        /// <summary>
        /// 获得/设置 是否启用 默认 false
        /// </summary>
        public bool Enabled { get; set; }

        /// <summary>
        /// 获得/设置 缓存键值
        /// </summary>
        public string Key { get; set; }

        /// <summary>
        /// 获得/设置 缓存目标地址
        /// </summary>
        public string Url { get; set; }

        /// <summary>
        /// 获得/设置 描述信息
        /// </summary>
        public string Desc { get; set; }

        /// <summary>
        /// 获得/设置 是否为本网站 默认 false
        /// </summary>
        public bool Self { get; set; }
    }
#else
    /// <summary>
    /// CacheCorsItem 实体类
    /// </summary>
    internal class CacheCorsItem : LgbConfigurationElement, ICacheCorsItem
    {
        /// <summary>
        /// 获得/设置 缓存目标地址
        /// </summary>
        [ConfigurationProperty("url")]
        public string Url { get { return (string)this["url"]; } set { this["url"] = value; } }

        /// <summary>
        /// 获得/设置 描述信息
        /// </summary>
        [ConfigurationProperty("desc")]
        public string Desc { get { return (string)this["desc"]; } set { this["desc"] = value; } }

        /// <summary>
        /// 获得/设置 是否为本网站 默认 false
        /// </summary>
        [ConfigurationProperty("self")]
        public bool Self { get { return (bool)this["self"]; } set { this["self"] = value; } }
    }
#endif
}
